import request from '@/utils/request'

// 查询论坛话题列表
export function listLabel(query) {
  return request({
    url: '/circle/label/list',
    method: 'get',
    params: query
  })
}

// 查询论坛话题详细
export function getLabel(id) {
  return request({
    url: '/circle/label/' + id,
    method: 'get'
  })
}

// 新增论坛话题
export function addLabel(data) {
  return request({
    url: '/circle/label/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data' // Important: set correct content type
    }
  })
}

// // 修改论坛话题
// export function updateLabel(data) {
//     return request({
//         url: '/forum/label',
//         method: 'put',
//         data: data
//     })
// }

// 删除论坛话题
export function delLabel(id) {
  return request({
    url: '/circle/label/delete',
    method: 'post',
    data: {'id': id},
    headers: {
      'Content-Type': 'multipart/form-data' // Important: set correct content type
    }
  })
}

// 标签排序
export function sortLabels(data) {
  return request({
    url: '/circle/label/sort',
    method: 'post',
    data: data
  })
}